package cn.innosmart.aq.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by David on 2015/8/17.
 */
public class CommandBean implements Parcelable {
    public static final Parcelable.Creator<CommandBean> CREATOR = new Parcelable.Creator<CommandBean>() {
        public CommandBean createFromParcel(Parcel source) {
            return new CommandBean(source);
        }

        public CommandBean[] newArray(int size) {
            return new CommandBean[size];
        }
    };
    //指令的序列
    private int order;
    //指令的类型
    private String type;
    //指令的执行列表
    private ArrayList<ActionBean> command;
    //指令的值
    private int value;
    //指令的场景ID
    private String scene_id;

    public CommandBean() {
    }

    protected CommandBean(Parcel in) {
        this.order = in.readInt();
        this.type = in.readString();
        this.command = new ArrayList<ActionBean>();
        in.readList(this.command, List.class.getClassLoader());
        this.value = in.readInt();
        this.scene_id = in.readString();
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public ArrayList<ActionBean> getCommand() {
        return command;
    }

    public void setCommand(ArrayList<ActionBean> command) {
        this.command = command;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getScene_id() {
        return scene_id;
    }

    public void setScene_id(String scene_id) {
        this.scene_id = scene_id;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.order);
        dest.writeString(this.type);
        dest.writeList(this.command);
        dest.writeInt(this.value);
        dest.writeString(this.scene_id);
    }
}
